package cn.jsony.pet.domain;

import java.math.BigDecimal;
import java.util.Date;
import cn.jsony.basic.domain.BaseDomain;
import cn.jsony.org.domain.Shop;
import cn.jsony.user.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 实体类：
 */
@Data
public class Pet extends BaseDomain{

    private String name;
    private BigDecimal costprice;
    private BigDecimal saleprice;
    /**
     * 类型id
     */
    private Long typeId;
    private PetType petType;

    private String resources;
    /**
     * 状态：0下架 1上架
     */
    private Integer state =0;
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date offsaletime;
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date onsaletime;
    @JsonFormat(pattern="yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createtime=new Date();
    /**
     * 宠物所在的店铺ID
     */
    private Long shopId;
    private Shop shop;
    /**
     * 如果被领养为领养用户id
     */
    private Long userId;
    private User user;

    /*宠物两种来源:1.店铺自己饲养宠物,searchMasterMsgId==null
    *            2.用户发布寻主消息,店铺去搜购物
    * */
    private Long searchMasterMsgId;

    private PetDetail petDetail;
}
